home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / faq-s.zip / CORRUPT.PAS < prev    next >
Pascal/Delphi Source File  |  1991-05-04  |  778b  |  38 lines

  1. program corrupt;
  2.  
  3. uses crt,dos,userret,gentypes,gensubs,configrt;
  4.  
  5. var old,new,u:userrec;
  6.     oldf,newf:file of userrec;
  7.     index:file of mstr;
  8.     i:integer;
  9.  
  10. begin
  11. readconfig;
  12. assign (oldf,bbsdatadir+'USERS.DAT');
  13. assign (newf,bbsdatadir+'USERS.NEW');
  14. assign (index,bbsdatadir+'USERINDX.DAT');
  15. if exist (bbsdatadir+'USERINDX.DAT') then begin
  16. close (oldf);
  17. reset (oldf);
  18. rewrite (newf);
  19. close (index);
  20. reset (index);
  21. for i:=1 to filesize (index) do begin
  22. seek (index,i-1);
  23. read (index,u.handle);
  24. seek (oldf,i-1);
  25. read (oldf,old);
  26. seek (newf,i-1);
  27. write (newf,old);
  28. end;
  29. textcolor (15);
  30. writeln ('User Fixing Complete!');
  31. textcolor (7);
  32. close (oldf);
  33. close (newf);
  34. close (index);
  35.  end else writeln ('User Files not found!');
  36. halt (0);
  37. end.
  38.